package com.wyx.action;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;

import com.wyx.entity.User;
import com.wyx.serves.UserServes;

public class RegistAction extends BaseAction{
    private User user;
    public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public String userRegist() throws IOException{
		UserServes userServes=new UserServes();
		boolean flag=userServes.userRegist(user.getUsername(), user.getUserpass());
		if (flag) {
			getMapSession().put("username", user.getUsername());
			getMapSession().put("userpass", user.getUserpass());
	    	return SUCCESS;
		}else{
			return ERROR;
		}	
	}
/*	public String execute() throws IOException{
    	PrintWriter out=getResponse().getWriter();
    	Date today=new Date();
    	out.print("<h2>用户注册信息如下：<hr>用户名："+
                getUsername()+"<br/>密　码："+getUserpass()+"<hr>");
    	out.print("正在进行注册"+today.toLocaleString()+"...");
    	return null;
    }*/
}
